package com.example.mapper;

import com.example.pojo.GoodType;
import com.example.pojo.Supplier;
import com.example.service.SupplierService;
import com.opencsv.CSVReader;
import com.opencsv.CSVWriter;
import com.opencsv.exceptions.CsvValidationException;
import org.apache.ibatis.annotations.*;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

@Mapper
public interface SupplierMapper {


    List<Supplier> getSupplier(Supplier supplier);

    @Delete("DELETE from supplier where supCode=#{id}")
    Integer deleteSupplier(String id);
    @Insert("INSERT INTO supplier values (#{supCode},#{supName},#{supMan},#{supPho},#{supDes})")
    Integer addSupplier(Supplier supplier);

    @Update("UPDATE supplier set supName=#{supName},supMan=#{supMan},supPho=#{supPho},supDes=#{supDes} where supCode=#{supCode}")
    Integer changeSupplier(Supplier supplier);

    @Select("SELECT * from supplier")
    List<Supplier> getSupplierList();
}
